import request from '@/utils/request'

export function listRole(query) {
  return request({
    url: '/system/role/getRolePageList',
    method: 'get',
    params: query
  })
}

export function getRoleInfo(roleId) {
  return request({
    url: '/system/role/getRoleInfo' + roleId,
    method: 'get'
  })
}

export function addRoleInfo(data) {
  return request({
    url: '/system/role/addRoleInfo',
    method: 'post',
    data: data
  })
}

export function delRoleInfo(roleId) {
  return request({
    url: '/system/role/delRoleInfo' + roleId,
    method: 'delete'
  })
}

export function changeRoleStatus(roleId, status) {
  const data = {
    roleId,
    status
  }
  return request({
    url: '/system/role/changeRoleStatus',
    method: 'put',
    data: data
  })
}
